'use strict'

process.env.BABEL_ENV = 'development';
process.env.NODE_ENV = 'development';
process.env.STATIC_ENV='development';

require('../config/env')
const fs = require('fs')
const chalk = require('chalk')
const webpack = require('webpack')
const WebpackDevServer = require('webpack-dev-server');
const clearConsole = require('react-dev-utils/clearConsole')
const checkRequiredFiles = require('react-dev-utils/checkRequiredFiles')

const {
    choosePort,
    createCompiler,
    prepareProxy,
    prepareUrls
} = require('react-dev-utils/WebpackDevServerUtils')
const openBrowser = require('react-dev-utils/openBrowser')
const paths = require('../config/paths')
const config = require('../webpack.config')
const createDevServerConfig = require('../config/webpackDevServer.config')
//const use

if(!checkRequiredFiles([paths.appHtml,paths.appIndexJs])){
    process.exit(1)
}

const DEFAULT_PORT = parseInt(process.env.PORT,10) || 3000
const HOST = process.env.HOST || '0.0.0.0'

choosePort(HOST,DEFAULT_PORT).then(port =>{
    if(port == null){
        return;
    }
    const protocol = process.env.HTTPS === 'true' ? 'https':'http'
    const urls = prepareUrls(protocol,HOST,port)
    const compiler = createCompiler()

})
